# zhaofeng-shu33
import numpy as np
from matplotlib import pyplot as plt
from sklearn.cluster import KMeans
from sklearn import preprocessing
colors = ['#FA5858', '#2A0A0A', '#F4FA58', '#BEF781', '#81F7D8', '#0431B4', '#BCA9F5', '#FE2EC8', '#F5A9BC', '#585858']

if __name__ == '__main__':
    data = np.loadtxt('route.csv', delimiter=',', skiprows=1)
    data2 = data[:,1:3]
    data3 = preprocessing.scale(data2)
    km = KMeans(n_clusters=10)
    k_means_labels = km.fit_predict(data3)
    for k, col in zip(range(10),colors):
        my_members = k_means_labels == k
        plt.scatter(data3[my_members,0], data3[my_members,1], color=col)
    plt.show()
    